          DISTANCE       subprogram                            PAGE  D5
          -------------------------------------------------------------
 
          Format         CALL DISTANCE(#sprite-number,#sprite-number,
                         numeric-variable,[,...])
 
                         CALL DISTANCE(#sprite-number,dot-row,
                         dot-column,numeric-variable[,...])
 
          Description
 
          The only thing added by RXB to DISTANCE is the auto repeat.
           See EXTENDED BASIC MANUAL page 80 for more data.
          DISTANCE runs from ROM.
 
 
          Program
 
          The program at the right will | >100 CALL CLEAR
          set up 3 sprites on screen and| >110 CALL SPRITE(#1,65,7,99,9
          start them moving.            |  9,0,10,#2,66,4,99,99,10,0,#3
                                        |  ,67,2,1,2,-50,-50)
          Scans three sprites locations | >120 CALL DISTANCE(#1,#2,D,#1
           and returns the distance from|  ,#3,E,#2,#3,F)
           each other squared.          | >130 DISPLAY AT(1,1):"#1/#2";
                                        |  D:"#1/#3";E:"#2/#3";F)
          Restart loop                  | >140 GOTO 120
                                        |
 
          Options
 
          While characters 144 to 159 are being used, you cannot use
          sprites. The DISTANCE subprogram does get more accurate if
          you have more than one to check at a time, but is slightly
          faster than normal XB as DISTANCE in RXB does not require
          a search for another line number to CALL DISTANCE and find
          a value. The RXB version just goes to the comma and finds
          the next value of DISTANCE, so is much faster and saves
          program memory.